This page last changed on Sep 23, 2007 by cholmes.

LESSON 1a Configuring a Data Directory

Objective: This tutorial will teach you how to configure a 'data directory', which is a way to keep your configuration separate from the current installation of GeoServer, making it very easy to upgrade to new versions of GeoServer with no additional configuration.

1) Getting the Data Directory

The file 'workshop-data.zip' has been provided, copy it to a stable location - C:/. This contains all the files needed to configure GeoServer. Unzip it, which should give you a directory C:/workshop-data

2) Examining the Data Directory

There are several ways to set the data directory. Binary/exe distributions have a default location that is checked first, at geoserver/data_dir. Open up that directory and explore.
(screenshot)

You should see two files and a number of directories. Open up catalog.xml and services.xml and look at the kind of data that is stored in there. Explore a few directories.

3) Setting the Data Directory

For this workshop we want to use a different data directory. Instead of using the default location we are going to set it to use another location. One could just copy the new directory to a the default location, but having a stable location lets one switch between different versions of GeoServer without copying directories around.

  1. Go to geoserver/webapps/geoserver/WEB-INF/
  2. Open web.xml
    (screenshot)
  3. Search for GEOSERVER_DATA_DIRECTORY
  4. Remove the comments around the parameter, by removing the '<!' and '->' on the lines above and below it.
  5. Set the parameter to C:/workshop-data, which is where you unzipped the workshop data.

4) Make sure it worked

  1. Restart GeoServer (hit stop and then start in the menu)
  2. Go to the web admin tool, http://localhost:8080/geoserver Go to the preview window and look at the available featureTypes. If 'sf:archsites' is not there then you successfully set the data directory.
Document generated by Confluence on Jan 16, 2008 23:27